# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=s6-overlay
pkgver=3.2.0.2
pkgrel=0
pkgdesc="s6 overlay for containers"
url=https://github.com/just-containers/s6-overlay
arch="noarch"
license="ISC"
_execline_version=2.9.6
_s6_version=2.13.1
_s6rc_version=0.5.5
_s6li_version=1.1.2
_s6pu_version=2.3.0
_s6lu_version=2.6.2
_s6dns_version=2.4.0
_s6net_version=2.7.0
_s6oh_version=0.1.1
depends="
	execline>=$_execline_version
	s6>=$_s6_version
	s6-rc>=$_s6rc_version
	s6-linux-init>=$_s6li_version
	s6-portable-utils>=$_s6pu_version
	s6-linux-utils>=$_s6lu_version
	s6-dns>=$_s6dns_version
	s6-networking>=$_s6net_version
	s6-overlay-helpers>=$_s6oh_version"
subpackages="$pkgname-doc $pkgname-syslogd"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/just-containers/s6-overlay/archive/refs/tags/v$pkgver.tar.gz"

build() {
	make rootfs-overlay-noarch symlinks-overlay-noarch syslogd-overlay-noarch \
		"VERSION=$pkgver" \
		SHEBANGDIR=/usr/bin
}

package() {
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	cp -a "$builddir/output/rootfs-overlay-noarch"/* \
		"$builddir/output/symlinks-overlay-noarch"/* \
		"$pkgdir/"
	cp "$builddir/AUTHORS.md" \
		"$builddir/CHANGELOG.md" \
		"$builddir/CONTRIBUTING" \
		"$builddir/COPYING" \
		"$builddir/DCO" \
		"$builddir/MOVING-TO-V3.md" \
		"$builddir/README.md" \
		"$pkgdir/usr/share/doc/$pkgname/"
}

syslogd() {
	mkdir -p "$subpkgdir"
	cp -a "$builddir/output/syslogd-overlay-noarch"/* "$subpkgdir/"
}

sha512sums="
21bf57952204dcdbc7e42c971109548a099256ed26535a4e5fe275e637bdd2d23cdb1618cf456d55a92741465f3ccd6405b17ec0d23392f62895a8c0f018898c  s6-overlay-3.2.0.2.tar.gz
"
